package com.aaa.service.system;



import com.aaa.entity.system.Menu;
import com.aaa.entity.system.PageEnty;
import com.aaa.entity.system.Role;
import com.github.pagehelper.Page;

import java.util.List;

/**
 * 角色信息表(Role)表服务接口
 *
 * @author makejava
 * @since 2022-08-31 20:32:53
 */
public interface RoleService {

    /**
     * @create by:
     * @description: 查询所有
     * @create time: 2022/9/7 14:18
     *  * @param null
    * @return
    */
    Page<Role> queryAllRolePage(PageEnty pageEnty, Role role);
    /**
     * @create by:
     * @description: 添加
     * @create time: 2022/9/7 14:18
     *  * @param null
    * @return
    */
    Role saveRole(Role role);
    /**
     * @create by:
     * @description: 修改
     * @create time: 2022/9/7 14:22
     *  * @param null
    * @return
    */
    Role updateRole(Role role);
    /**
     * @create by:
     * @description: 删除
     * @create time: 2022/9/7 14:28
     *  * @param null
    * @return
    */
    int deleteRole(Integer roleId);
    /**
     * @create by:
     * @description: 用户名重复
     * @create time: 2022/9/7 13:59
     *  * @param null
    * @return
    */
    boolean findRoleByName(Role role);
    /**
     * @create by:
     * @description: 查询菜单
     * @create time: 2022/9/7 13:59
     *  * @param null
    * @return
    */
    List<Menu> queryAllMenu();
    /**
     * @create by:
     * @description: 在role_menu中添加数据
     * @create time: 2022/9/7 13:59
     *  * @param null
    * @return
    */
    void insertRoleMenu(int roleId, String[] menusId);
    /**
     * @create by: 梦浩然
     * @description: 删除
     * @create time: 2022/9/7 14:00
     *  * @param null
    * @return
    */
    int deleteByRoleId(Integer roleId);
    /**
     * @create by:
     * @description: 修改
     * @create time: 2022/9/7 14:00
     *  * @param null
    * @return
    */
    void updateRoleMenu(Integer roleId, String[] menusId);
    /**
     * @create by:
     * @description: 查询对应人的菜单
     * @create time: 2022/9/7 14:00
     *  * @param null
    * @return
    */
    List<Integer> findSelectMenu(int roleId);

    /**
     * @create by:
     * @description: 查找roleKey
     * @create time: 2022/9/7 14:00
     *  * @param null
    * @return
    */
    boolean findRoleKey(Role role);

    /**
     * 通过ID查询单条数据
     *
     * @param roleId 主键
     * @return 实例对象
     */
    Role queryById(Integer roleId);

    /**
     * 获取全部角色
     * @return List<Role>
     */
    List<Role> queryAllRole();
}
